package com.mapreduce.flowcomparablepartition;

import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;

import java.io.IOException;

public class FlowCountReducer extends Reducer<FlowBean, Text,Text, FlowBean> {

    @Override
    protected void reduce(FlowBean key, Iterable<Text> values, Context context) throws IOException, InterruptedException {
       //  key =<240,(13729199489,13768778790,13966251146)>
        //循环输出，避免总流量相同的情况
        for (Text value : values) {
            Text k4 = new Text();
            k4.set(value);
            FlowBean v4 = key;
            context.write(k4,v4);
        }
    }
}
